package com.idbk.chargestation.activity.user;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.idbk.chargestation.R;
import com.idbk.chargestation.adapter.MessageAdapter;
import com.idbk.chargestation.base.BaseActivity;
import com.idbk.chargestation.bean.JsonMyMessage;

/**
 * 查看消息
 * @author lupc
 *
 */
public class ActivityMyMessageDetail extends BaseActivity {


	private TextView tvTag,tvDate,tvContent;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.activity_message_detail);

		setupView();

		setupData();
	}

	private void setupView() {
		setupToolBar2();//显示标题栏
		tvTag = (TextView)findViewById(R.id.message_detail_tag);
		tvDate = (TextView)findViewById(R.id.message_detail_time);
		tvContent = (TextView)findViewById(R.id.message_detail_content);
	}

	private void setupData(){
		JsonMyMessage message = (JsonMyMessage) getIntent().getSerializableExtra(MessageAdapter.FROM_MESSAGE_MESSAGE_OBJ);
		if (message.tag == null){
			tvTag.setText(message.content);
			tvDate.setText(message.date);
			tvContent.setVisibility(View.GONE);
		} else {
			tvTag.setText(message.tag);
			tvDate.setText(message.date);
			tvContent.setText(message.content);
		}
		
		//根据tag决定 tag底色
	//	MessageAdapter.fillMessageTag(context, message, tvTag);
	}

}
